<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

// Route::get('/', function () {
//     return view('welcome');
// });
//前台维护 关站或者开站
Route::get('/','Home\IndexController@view');

//======后台登录开始========
//后台用户登录
Route::get('/admin/login/login','Admin\LoginController@login');
Route::post('/admin/login/dologin','Admin\LoginController@dologin');
//后台用户退出
Route::get('/admin/login/quit','Admin\LoginController@quit');
//======后台登录结束========


// //后台首页路由
// Route::get('/admin/index/index','Admin\IndexController@index');
Route::group(['middleware' => ['web','admin.login.login']], function () {

  	//后台首页路由
	Route::get('/admin/index/index','Admin\IndexController@index');
});



//用户管理
//用户添加页面的路由
Route::get('/admin/user/add','Admin\UserController@add');
//执行用户添加的路由
Route::post('/admin/user/insert','Admin\UserController@insert');
//用户列表的路由
Route::get('/admin/user/show','Admin\UserController@show');
//用户编辑页面的路由
Route::get('/admin/user/edit/{id}','Admin\UserController@edit');
//用户删除的路由
Route::get('/admin/user/delete/{id}','Admin\UserController@delete');
//用户修改的路由 
Route::post('/admin/user/update/','Admin\UserController@update');


//员工管理
//员工添加页面的路由
Route::get('/admin/staff/add','Admin\StaffController@add');
//执行员工添加的路由
Route::post('/admin/staff/insert','Admin\StaffController@insert');
// //员工列表的路由
Route::get('/admin/staff/show','Admin\StaffController@show');
// //员工编辑页面的路由
Route::get('/admin/staff/edit/{id}','Admin\StaffController@edit');
// //员工删除的路由
Route::get('/admin/staff/delete/{id}','Admin\StaffController@delete');
// //员工修改的路由 
Route::post('/admin/staff/update','Admin\StaffController@update');



//商品管理
//商品添加
Route::get('/admin/goods/add','Admin\GoodsController@add');
//商品添加
Route::post('/admin/goods/insert','Admin\GoodsController@insert');
//商品列表
Route::get('/admin/goods/show','Admin\GoodsController@show');
//商品查看
Route::get('/admin/goods/edit','Admin\GoodsController@edit');
Route::get('/admin/goods/edit/{id}','Admin\GoodsController@edit');
//商品修改
Route::post('/admin/goods/update/','Admin\GoodsController@update');
//商品删除
Route::get('/admin/goods/delete/{id}','Admin\GoodsController@delete');
//图像管理
Route::get('/admin/goods/goodspic/{id}','Admin\GoodsController@goodspic');


//========友情链接开始========
//链接列表
Route::get('/admin/conf/link/show','Admin\LinkController@show');
//链接添加
Route::get('/admin/conf/link/add','Admin\LinkController@add');
Route::post('/admin/conf/link/insert','Admin\LinkController@insert');
//链接编辑
Route::get('/admin/conf/link/edit/{id}','Admin\LinkController@edit');
Route::post('/admin/conf/link/update','Admin\LinkController@update');
//链接删除
Route::get('/admin/conf/link/delete/{id}','Admin\LinkController@delete');
//=======友情链接结束========



//商品收藏管理
//添加商品收藏页面
Route::get('/admin/goodscollect/add','Admin\GoodsCollectController@add');
//执行商品添加
Route::post('/admin/goodscollect/insert','Admin\GoodsCollectController@insert');
//商品收藏列表
Route::get('/admin/goodscollect/index','Admin\GoodsCollectController@index');
//用户编辑页面的路由
Route::get('/admin/goodscollect/edit/{id}','Admin\GoodsCollectController@edit');
//用户删除的路由
Route::get('/admin/goodscollect/delete/{id}','Admin\GoodsCollectController@delete');
//用户修改的路由 
Route::post('/admin/goodscollect/update','Admin\GoodsCollectController@update');


//文章管理
//文章管理添加路由
Route::resource('admin/article','Admin\ArticleController');


//卖家管理
//卖家添加页面的路由
Route::get('/admin/seller/add','Admin\SellerController@add');
//执行卖家添加的路由
Route::post('/admin/seller/insert','Admin\SellerController@insert');
// //卖家列表的路由
Route::get('/admin/seller/index','Admin\SellerController@index');
// //卖家编辑页面的路由
Route::get('/admin/seller/edit/{id}','Admin\SellerController@edit');
// //卖家删除的路由
Route::get('/admin/seller/delete/{id}','Admin\SellerController@delete');
// //卖家修改的路由 
Route::post('/admin/seller/update','Admin\SellerController@update');


//商铺管理
//商铺添加页面的路由
Route::get('/admin/shop/add','Admin\ShopController@add');
//执行商铺添加的路由
Route::post('/admin/shop/insert','Admin\ShopController@insert');
// // 商铺列表的路由
Route::get('/admin/shop/index','Admin\ShopController@index');
// // 商铺编辑页面的路由
Route::get('/admin/shop/edit/{id}','Admin\ShopController@edit');
// // 商铺删除的路由
Route::get('/admin/shop/delete/{id}','Admin\ShopController@delete');
// // 商铺修改的路由 
Route::post('/admin/shop/update','Admin\ShopController@update');




//ajax
Route::post('/admin/goods/ajaxCate','Admin\GoodsController@ajaxCate');
//ajax
Route::post('/admin/goods/ajax','Admin\GoodsController@ajax');
//品牌管理
Route::get('/admin/brand/add','Admin\BrandController@add');
//品牌添加
Route::post('/admin/brand/insert','Admin\BrandController@insert');
//品牌列表
Route::get('/admin/brand/show','Admin\BrandController@show');
//品牌编辑
Route::get('/admin/brand/edit/{id}','Admin\BrandController@edit');
//品牌修改
Route::post('/admin/brand/update','Admin\BrandController@update');
//品牌删除
Route::get('/admin/brand/delete/{id}','Admin\BrandController@delete');


//分类管理
Route::get('/admin/cate/add','Admin\CateController@add');
//分类添加
Route::post('/admin/cate/insert','Admin\CateController@insert');
//分类列表
Route::get('/admin/cate/show','Admin\CateController@show');
//分类编辑
Route::get('/admin/cate/edit/{id}','Admin\CateController@edit');
//分类修改
Route::post('/admin/cate/update','Admin\CateController@update');
//分类删除
Route::get('/admin/cate/delete/{id}','Admin\CateController@delete');


//订单管理路由
//订单列表
Route::get('/admin/order/index','Admin\OrderController@index');
//订单编辑
Route::get('/admin/order/edit/{id}','Admin\OrderController@edit');
//订单修改
Route::post('/admin/order/update','Admin\OrderController@update');
// //订单详情删除
Route::get('/admin/order/delete/{id}','Admin\OrderController@delete');
// //订单详情
Route::get('/admin/order/detail/{id}','Admin\OrderController@detail');
//订单删除
Route::get('/admin/order/del/{id}','Admin\OrderController@del');
//商品状态
Route::post('/admin/order/status','Admin\OrderController@status');

//=====商品评价管理开始=========
// 评价列表
Route::get('/admin/comment/show','Admin\CommentController@show');
//评价删除
Route::get('/admin/comment/delete/{id}','Admin\CommentController@delete');
//评价回复添加
Route::get('/admin/reply/add/{id}','Admin\CommentController@add');
Route::post('/admin/reply/insert','Admin\CommentController@insert');
//=====商品评价管理结束=========


//======评价回复管理开始=====
Route::get('/admin/reply/reply','Admin\CommentController@reply');
Route::get('/admin/reply/del/{id}','Admin\CommentController@del');
//======评价回复管理结束====


//=======网站配置开始======
//更新配置列表
Route::get('/admin/conf/config/edit','Admin\ConfigController@edit');
Route::post('/admin/conf/config/update','Admin\ConfigController@update');
//=======网站配置结束======



//====================================前台路由====================================================

//前台路由
//前台登录路由
Route::get('/login','Home\LoginController@login');
Route::get('/login/logout','Home\LoginController@quit');
//验证码路由
Route::get('/createcode/{id}','Home\LoginController@createcode');
//处理登录路由
Route::post('/dologin','Home\LoginController@dologin');
//前台注册
Route::get('/home/reg/add','Home\RegController@add');
//注册
Route::post('/home/reg/insert','Home\RegController@insert');


//=======重置密码开始=========
//输入邮箱页
Route::get('/reset','Home\ResetController@reset');
//ajax判断邮箱
Route::post('/reset/email','Home\ResetController@email');
//发送密码处理
Route::post('/send','Home\ResetController@send');
//发送状态页
Route::get('/info','Home\ResetController@info');
//重置密码页
Route::get('/new/id/{id}/token/{token}','Home\ResetController@newform');
//ajax判断密码输入是否一致
Route::post('/reset/password','Home\ResetController@password');
//更新密码处理
Route::post('/update','Home\ResetController@update');
//重置成功页
Route::get('/resetok','Home\ResetController@ok');
//=======重置密码结束=========


// ========个人中心开始=========
//-------基本信息列表开始--------
Route::get('/user','Home\CenterController@show');
//ajax判断
//邮箱
Route::post('/user/email','Home\CenterController@email');
//手机
Route::post('/user/phone','Home\CenterController@phone');
//修改基本信息
Route::post('/user/update','Home\CenterController@update');
//-------基本信息列表结束--------

//--------头像开始-------
Route::get('/upic','Home\CenterController@upic');
//修改头像
Route::post('/upic/upload','Home\CenterController@upload');
//-------头像结束----------

//-------收货地址开始--------
Route::get('/address','Home\CenterController@address');
Route::post('/address/uphone','Home\CenterController@uphone');
//ajax发送收据地址到数据库
Route::post('/send_address','Home\CenterController@send');
//删除收货地址
Route::get('/address/del/{id}','Home\CenterController@del');
//编辑收货地址
Route::get('/address/edit/{id}','Home\CenterController@edit');
Route::post('/address/update','Home\CenterController@change');

//--------收货地址结束------------------

//---------我的订单开始----------------
//订单详情
Route::get('/dingdan','Home\CenterController@dingdan');
//评价列表
Route::get('/comment_detail/{id}','Home\CenterController@commentDetail');
//删除订单
Route::get('/dingdan/del/{id}','Home\CenterController@delete');
//写评论
Route::get('/comment/{id}','Home\CenterController@comment');
//发评论
Route::post('/comment_up','Home\CenterController@comment_up');
//订单商品详情
Route::get('/dingdan_detail/{id}','Home\CenterController@dingdan_detail');
//----------我的订单结束---------------

//-----------修改密码开始----------------
Route::get('/changepass','Home\CenterController@changepass');
Route::post('/pass','Home\CenterController@pass');
//-----------修改密码结束------------------

// ========个人中心结束=========




//京东首页
// Route::get('/welcome','Home\IndexController@show');

//注册用户验证
Route::get('/home/reg/ajax','Home\RegController@ajax');
//注册用户密码验证
Route::get('/home/reg/ajaxp','Home\RegController@ajaxp');
//注册用户第二次密码验证
Route::get('/home/reg/ajaxrp','Home\RegController@ajaxrp');
//注册用户邮箱验证
Route::get('/home/reg/email','Home\RegController@email');

//=========商品详情路由=========

//商品展示
Route::get('/cshow/{id}','Home\GshowController@show');
//商品搜索
Route::post('/cshow','Home\GshowController@search');

Route::get('/bshow/{id}','Home\GshowController@show1');

Route::get('/detail/{id}','Home\DetailController@show');

//=========商品关注=========
Route::get('/collect/{id}','Home\DetailController@collect');

//========购物车添加============
Route::post('/cart_insert','Home\DetailController@insert');

//========生成订单===========
Route::get('/order_add/{cartid}/{num}','Home\CartController@add');

//========添加新地址========
Route::post('/add_address','Home\CartController@insert');

//======设置默认地址========
Route::post('/change','Home\CartController@change');
//=======删除地址==========
Route::post('/delete','Home\CartController@delete');
//========我的订单==========
Route::post('/sub_order','Home\CartController@sub');

//========购物车============
Route::get('/cart','Home\CartController@show');
Route::post('/cart/balance','Home\CartController@balance');
Route::post('/cart/delete1','Home\CartController@delete1');
